package com.my.test.java.autocode.entiy;

import java.util.List;

import com.my.test.java.autocode.util.ACStringUtils;


public class ClassPro {
	private String decorate;
	private String packageName;
	private String className;
	private List<Methods> mes;
	private List<Proporty> pros;
	private List<String> imports;
	
	public ClassPro(){}
	public ClassPro(String decorate,String packageName,String className,List<Methods> mes,List<Proporty> pros,List<String> imports){
		this.decorate = decorate;
		this.packageName = packageName;
		this.className = className;
		this.mes = mes;
		this.pros = pros;
		this.imports = imports;
	}
	public String initClas(){
		StringBuilder bs = new StringBuilder();
		bs.append("package "+packageName).append(ACStringUtils.StringType.newline).append(ACStringUtils.StringType.newline);
		if(null!=imports){
			for(String im:imports){
				if(im.startsWith("import")){
					bs.append(im).append(ACStringUtils.StringType.newline);
				}else{
					bs.append("import ").append(im).append(ACStringUtils.StringType.newline);
				}
			}
		}
		bs.append(ACStringUtils.StringType.newline);
		bs.append(decorate).append(" class ").append(className+"{");
		bs.append(ACStringUtils.StringType.newline);
		if(null!=pros){
			for(Proporty pro:pros){
				bs.append(pro.initPro());
			}
		}
		bs.append(ACStringUtils.StringType.newline);
		if(null!=mes){
			for(Methods m:mes){
				bs.append(m.initMethod()).append(ACStringUtils.StringType.newline);
			}
		}
		bs.append("}");
		return bs.toString();
	}
	public String getPackageName() {
		return packageName;
	}
	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public List<Methods> getMes() {
		return mes;
	}
	public void setMes(List<Methods> mes) {
		this.mes = mes;
	}
	public List<Proporty> getPros() {
		return pros;
	}
	public void setPros(List<Proporty> pros) {
		this.pros = pros;
	}
	public List<String> getImports() {
		return imports;
	}
	public void setImports(List<String> imports) {
		this.imports = imports;
	}
}
